#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo02.py
@time:2022/01/27
"""
import struct


def test01():
    ...
    opt = struct.unpack('<10sHHb',b'raymond   \x32\x12\x08\x01\x08')
    print(opt[0].decode('utf8'))
    print(opt[1])


def test02():
    ...
    elf = open('/Users/apple/Documents/tmp/SimpleSection.o', 'rb')
    elf_ehdr = elf.read(64)
    opt = struct.unpack('<16c', elf_ehdr[0:16])
    print(opt)

    elf.close()

if __name__ == '__main__':
    pass
    test02()